<template>
	<div>
		<el-cascader size="large" :options="options" v-model="selectedOptions" @change="handleChange">
		</el-cascader>
	</div>
</template>

<script>
	import {provinceAndCityData,CodeToText,TextToCode} from 'element-china-area-data'
	export default {
		data() {
			return {
				options: provinceAndCityData,
				selectedOptions: []
			}
		},

		methods: {
			handleChange() {
				
				var loc = "";
				for (let i = 0; i < this.selectedOptions.length; i++) {
					loc += CodeToText[this.selectedOptions[i]];
				}
				var a = CodeToText[140300]
				console.log(a)
				console.log(loc)
				console.log(this.selectedOptions)//打印区域码所对应的属性值即中文地址
				console.log(this.selectedOptions[1])
			}
		}
	}
</script>

<style>
</style>
